<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'notes-form',
	'action'=>$request=='create'?'index.php?r=jobsnotes/create':'index.php?r=jobsnotes/update&id='.$model->id
        
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
        <?php echo $form->hiddenField($model,'jobid');?>


	<div class="row">
		<?php echo $form->labelEx($model,'dateofnote'); ?>
		 <?php $this->widget('zii.widgets.jui.CJuiDatePicker',array(
                    'model'=>$model,
                    'attribute'=>'dateofnote',
                    'value'=>CTimestamp::formatDate('m-d-Y',$model->dateofnote),
                    'options' => array('dateofnote'=>'m-d-yy'),
                )); ?>
		<?php echo $form->error($model,'dateofnote'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'note'); ?>
		<?php echo $form->textArea($model,'note'); ?>
		<?php echo $form->error($model,'note'); ?>
	</div>

	<div class="row_buttons">
            <?php if($model->isNewRecord):?>
		<?php echo CHtml::ajaxSubmitButton('Save', 'index.php?r=jobsnotes/create', array(
                    'success'=>'js:function(data){
                            if(data=="true"){                        
                                $("#notedialog").dialog("close");
                                
                            }
                          
                        }'
                ),array('id'=>'closeDialog12'));?>
            <?php else:?>
                <?php echo CHtml::ajaxSubmitButton('Save', 'index.php?r=jobsnotes/update&id='.$model->id, array(
                    'success'=>'js:function(data){
                            if(data=="true"){                        
                                $("#notedialog").dialog("close");                                
                            }                          
                        }'
                ),array('id'=>'closeDialog12'));?>
            <?php endif?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->